Duplicated Code ^^^^^ **Definition:** * If you have duplicated code in tests, it makes it harder to refactor the implementation code because you have a disproportionate number of tests to update. Tests should help you refactor with confidence, rather than be a large burden that impedes your work on the code being tested. **Code Example:** .. code-block:: java assertEqual('Joe', person.getFirstName()) assertEqual('Bloggs', person.getLastName()) assertEqual(23, person.getAge()) **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `A Refactoring Tool for TTCN-3 `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `An Empirical Study into the Relationship Between Class Features and Test Smells `_ :octicon:`graph;1em` * `Is duplicated code more tolerable in unit tests? `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `Test Smell Detection Tools: A Systematic Mapping Study `_ * `TestQ: Exploring Structural and Maintenance Characteristics of Unit Test Suites `_ * `What We Know About Smells in Software Test Code `_ * `Writing good gherkin `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em`